<?php

/**
 * Description of IndexController
 *
 * @author minhhq
 */
class IndexController extends Core_Controller_Action
{

    public function indexAction()
    {
        if ("mobile" == Core_MobileDetect::getCurrentDevice()) {
            $session = Zend_Registry::get("session");
            if($session->user){
                $this->redirect("/tracking");
            }
            $this->_helper->layout()->setLayout("layout_mobile");
            $this->render('indexmobile');
        } else {
            $port_db = new Core_Model_DbTable_Ports();
            $this->view->ports = json_encode($port_db->getAll()->toArray());

            $sliding_image_db = new Core_Model_DbTable_SlidingImages();
            $this->view->sliding_images = $sliding_image_db->getAll();
        } 
    }

    public function indexmobileAction()
    {

    }


}

?>
